package com.example.ccjml;

import androidx.annotation.IntDef;


import com.example.ccj.b.c.form.MForm;
import com.example.ccj.b.c.form.MFormDataField;
import com.example.ccj.b.c.form.MFormField;
import com.example.ccj.u.GenerateId;
import com.example.ccj.u.TimeUtils;

import java.io.Serializable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;


@MForm("新建任务")
public class Task  implements Serializable {

    //日常任务
    public static final int RI_CHANG_TASK = 0;
    //做题任务
    public static final int ZUO_TI_TASK = 1;

    @IntDef({RI_CHANG_TASK,ZUO_TI_TASK})
    @Retention(RetentionPolicy.SOURCE)
    public @interface TaskType{ }

    public Task(){
        id = GenerateId.getNoRepeatTimeIdToStr();
        createUser = String.valueOf(4);
        createTime = TimeUtils.getNowString();
    }

    @MFormField(value = "Id",isNoNUll = true,isCanModify = false,order = 1)
    @MFormDataField(value = "编号",order = 1)
    private String id;

    @MFormField(value = "名称",isNoNUll = true,order = 2)
    @MFormDataField(value = "名称",order = 2)
    private String name;
    @MFormField(value = "选择任务类型",isNoNUll = true,type = MFormField.DAN_OPTION,order = 3)
    @MFormDataField(value = "任务类型",order = 3)
    private @TaskType int type;

    private String analysis;//任务加载解析文本
    private String img;//任务图片
    @MFormField(value = "说明",order = 5,maxLength = -1,superF = "type.0")
    @MFormDataField(value = "说明",order = 4,type = MFormDataField.IMG)
    private String illustrate;
    private String createTime;
    private String createUser;
    @MFormField(value = "执行人",order = 4,type = MFormField.DAN_OPTION,maxLength = -1)
    @MFormDataField(value = "执行人",order = 5,type = MFormDataField.JUMP)
    private String executor;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getAnalysis() {
        return analysis;
    }

    public void setAnalysis(String analysis) {
        this.analysis = analysis;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getIllustrate() {
        return illustrate;
    }

    public void setIllustrate(String illustrate) {
        this.illustrate = illustrate;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getExecutor() {
        return executor;
    }

    public void setExecutor(String executor) {
        this.executor = executor;
    }

    @Override
    public String toString() {
        return "Task{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", type=" + type +
                ", analysis='" + analysis + '\'' +
                ", img='" + img + '\'' +
                ", illustrate='" + illustrate + '\'' +
                ", createTime='" + createTime + '\'' +
                ", createUser='" + createUser + '\'' +
                ", executor='" + executor + '\'' +
                '}';
    }
}
